﻿using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;

namespace ConsoleApp1
{
    internal class Program
    {
       static void Main(string[] args)
        {
            GenericList<int> intList = new GenericList<int>();
            intList.Add(10);
            intList.Add(20);
            intList.Add(30);
            intList.Add(40);
            intList.Add(50);

            int max = intList.Head.Data;
            intList.ForEach(x => max=max>x?max:x);

            int min=intList.Head.Data;
            intList.ForEach(x=>min=min<x?min:x);

            int sum = 0;
            intList.ForEach(x=>sum+=x);

            Console.WriteLine(max);
            Console.WriteLine(min);
            Console.WriteLine(sum);
        }
    }
}
